char msg[]="This is a list of tasks being preemptively multitasked by Wimp2 and information about them. Click MENU to alter the configuration of the task.";
_kernel_swi_regs r;
strcpy((char *) msgblk+20,msg);
*(int *)(msgblk+0)=256;
*(int *)(msgblk+16)=0x503;/*Message_HelpGive*/
*(int *)(msgblk+12)=*(int *)(msgblk+8);
r.r[0]=17;
r.r[1]=msgblk;
r.r[2]=*(int *)(msgblk+4);
_kernel_swi(0x400e7/*Wimp_SendMessage*/, &r, &r);
return 1;
}
return 0;
break;
default:
return 0;
break;
}
}
unsigned int rnd(int val)
{
int n;
for(n=0;n<32;n++)
{
seed=seed<<1;
if(seed & (1<<30))
{
seed=seed^XOR_SPECIAL;
}
}
n=seed % val;
if(n>=0)
return n;
else
return -n;
}
int ROReportError(int flags, int *blk)
{
_kernel_swi_regs r;
char tmesg[]="Wimp2 Demo";
r.r[0]=(int) blk;
r.r[1]=flags;
r.r[2]=(int) tmesg;
_kernel_swi(0x400df/*Wimp_ReportError*/, &r, &r);
if(flags & 0x100)
exit(EXIT_FAILURE);
return r.r[1];
}
int ROReportErrora(int flags, int errno, char *errstr)